#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "lcm_author.h"
char* CPUID[]=
{
    "000000001d8d7991"
};
char* syscmd="cat /proc/cpuinfo | grep 'Serial'|awk '{print$3}'";
int lcm_author()
{
    //get the cpu id
    FILE *fstream=NULL;
    char buff[17];
    memset(buff,0,sizeof(buff));
    if(NULL==(fstream=popen(syscmd,"r")))
    {
        printf("execute command failed: %s",strerror(errno));
        return 0;
    }
    if(NULL==fgets(buff, sizeof(buff), fstream))
    {
        pclose(fstream);
        return 0;
    }   
    printf("=>%s\n",buff);
    pclose(fstream);
    int i=0;
    for(i=0;i<sizeof(CPUID)/sizeof(CPUID[0]);i++){
        if(strcmp(buff,CPUID[i])==0){
            return 1;
        }
    }
    return 0;
}